package com.tuling.excludefilter;

import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;

import java.io.IOException;

/**
 * @author : fujc-dev@qq.com
 * @motto : talk is cheap, show me the code. salute the future!
 */

public class MyTypeExcludeFilter extends TypeExcludeFilter {

    private static final String CURRENT_HELLO_CONTROLLER = "HelloController";

    @Override
    public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException {
        //自定义的排除过滤规则
        if (CURRENT_HELLO_CONTROLLER.equals(metadataReader.getClassMetadata().getClassName())) {
            return true;
        }
        return false;
    }
}
